package com.lefevre.cms.bean.payment;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 支付校验日志
 *
 * @author Lefevre
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("payment_verification_log")
@Entity
@Table(name = "payment_verification_log", indexes = {@Index(name = "userName_idx", columnList = "parameterId,userName")})
public class PaymentVerificationLog implements Serializable {
    private static final long serialVersionUID = 276638020371536856L;

    /**
     * 支付流水号
     **/
    @Id
    @Column(length = 32)
    @TableId(type = IdType.INPUT)
    private String id;

    /**
     * 支付模块 1.订单支付  5.用户充值
     **/
    @TableField("paymentModule")
    private Integer paymentModule;

    /**
     * 参数Id    订单Id ,用户Id
     **/
    @TableField("parameterId")
    private Long parameterId;

    /**
     * 用户名称
     **/
    @Column(length = 30)
    @TableField("userName")
    private String userName;

    /**
     * 时间
     **/
    @Temporal(TemporalType.TIMESTAMP)
    @TableField("times")
    private Date times = new Date();

    /**
     * 支付金额
     **/
    @Column(nullable = false, precision = 12, scale = 2)
    @TableField(value = "paymentAmount", numericScale = "2")
    private BigDecimal paymentAmount = new BigDecimal("0.00");

}
